<template>
	<view>
		<view class="shop_name">商户：{{data.sh}}</view>
		<view class="carry_title">支付积分</view>
		<view class="input_box">
			<!-- <view class="text">￥</view> -->
			<input type="number" placeholder="请输入"  v-model="money"/>
			<!-- <view class="all">全部</view> -->
		</view>
		<view class="carry_text">当前积分余额: {{data.j}}</view>
		
		<button class="confirm02" @tap='go'>确认</button>
	<!-- 	<view class="carry_text02">温馨提示：17:00前提现当日到账，17:00后提现次日到账</view> -->
		
	</view>
</template>

<script>
export default {
	data() {
		return {
			data:[],
			id:'',
			money:''

		};
	},
	onLoad(e){
           let me = this;	
				
					me.id=e.id;
		       
				me.Net._get('sh_data',{id:me.id},(res)=>{
					if(res.code ==1){
						me.data=res.data
				
					}
				});	
	},
	methods: {
	go(){
		let me = this;
						
						
		    if(me.money<=0 || !me.money)
		    {
		    	me.Msg.Fail('请输入积分');
		    	return
		    }
						me.Net._get('payB',{id:me.id,money:me.money},(res)=>{
							if(res.code ==1){
							me.Msg.Success('支付成功',()=>{
							uni.switchTab({
								url:'/pages/personal/personal'
							})
							})
						
							}
						});	
	},
		gotopage(e){
			let url = e.currentTarget.dataset.url;
			uni.navigateTo({
				url:url
			})
		}
		
	}
};
</script>

<style lang="scss">
page {
	height: 100%;
	padding-bottom: 0 !important;
	background-color: #fff;
}

.shop_name{
	width: 92%;
	margin: 0 auto;
	font-weight: bold;
	font-size: 4vw;
	color: #333;
	margin-top: 6vw;
}

.carry_title {
	width: 92%;
	margin: 0 auto;
	font-size: 3.5vw;
	color: #333;
	margin-top: 6vw;
}

.carry_text {
	width: 92%;
	margin: 0 auto;
	font-size: 3vw;
	color: #999;
	margin-top: 6vw;
}

.carry_text02 {
	width: 92%;
	margin: 0 auto;
	font-size: 3vw;
	color: #999;
	margin-top: 3vw;
	text-align: center;
}

.input_box {
	width: 92%;
	margin: 0 auto;
	display: flex;
	height: 13.5vw;
	margin-top: 3vw;
}

.input_box .text {
	font-size: 8vw;
	color: #333;
	line-height: 13.5vw;
}

.input_box input {
	flex: 1;
	height: 13.5vw;
	font-size: 8vw;
	color: #333;
}

.input_box .all {
	font-size: 4vw;
	color: #ff5301;
	width: 13vw;
	line-height: 13.5vw;
	text-align: right;
}

	
</style>